<div class="yiiForm">

<?php $this->widget('application.components.RequiredMessage'); ?>

<?php
echo CHtml::beginForm();
echo CHtml::activeHiddenField($model, 'user_type');
?>

<?php echo CHtml::errorSummary($model); ?>

<?php

if (!$update) {
?>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'username'); ?>
<?php echo CHtml::activeTextField($model,'username',array('size'=>20,'maxlength'=>20)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'password'); ?>
<?php echo CHtml::activePasswordField($model,'password',array('size'=>50,'maxlength'=>50,'text'=>'')); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'password_check'); ?>
<?php echo CHtml::activePasswordField($model,'password_check',array('size'=>50,'maxlength'=>50,'text'=>'')); ?>
</div>
<?php

} else {
	echo CHtml::activeHiddenField($model, 'username');
}
?>

<div class="simple">
<?php echo CHtml::activeLabelEx($model,'language'); ?>
<?php echo CHtml::activeDropDownList($model,'language',Constants::userLanguages(), array()); ?>
</div>

<div class="simple">
<?php echo CHtml::activeLabelEx($model,'email'); ?>
<?php echo CHtml::activeTextField($model,'email',array('size'=>60,'maxlength'=>255)); ?>
</div>

<div class="simple">
<?php echo CHtml::activeLabelEx($model,'administrator ?'); ?>
<?php echo CHtml::activeCheckBox($model,'administrator'); ?>
</div>

<div class="action">
<?php echo CHtml::submitButton($update ? Yii::t('views','Save') : Yii::t('views','Create')); ?>
</div>

<?php echo CHtml::endForm(); ?>

</div><!-- yiiForm -->